Class java.lang.Short
All Packages Class Hierarchy This Package Previous Next Index
Class java.lang.Short
Object
|
+----Number
|
+----java.lang.Short
- public final class Short
- extends Number
The Short class is the standard wrapper for short values.
- Version:
- 1.8, 07/01/98
- Author:
- Nakul Saraiya
- Since:
- JDK1.1
- See Also:
- Number
-
MAX_VALUE
- The maximum value a Short can have.
-
MIN_VALUE
- The minimum value a Short can have.
-
TYPE
- The Class object representing the primitive type short.
-
java.lang.Short(short)
- Constructs a Short object initialized to the specified short value.
-
java.lang.Short(String)
- Constructs a Short object initialized to the value specified by the
String parameter.
-
byteValue()
- Returns the value of this Short as a byte.
-
decode(String)
- Decodes a String into a Short.
-
doubleValue()
- Returns the value of this Short as a double.
-
equals(Object)
- Compares this object to the specified object.
-
floatValue()
- Returns the value of this Short as a float.
-
hashCode()
- Returns a hashcode for this Short.
-
intValue()
- Returns the value of this Short as an int.
-
longValue()
- Returns the value of this Short as a long.
-
parseShort(String)
- Assuming the specified String represents a short, returns
that short's value.
-
parseShort(String, int)
- Assuming the specified String represents a short, returns
that short's value.
-
shortValue()
- Returns the value of this Short as a short.
-
toString(short)
- Returns a new String object representing the specified
Short.
-
toString()
- Returns a String object representing this Short's value.
-
valueOf(String, int)
- Assuming the specified String represents a short, returns a
new Short object initialized to that value.
-
valueOf(String)
- Assuming the specified String represents a short, returns a
new Short object initialized to that value.
MAX_VALUE
public static final short MAX_VALUE
- The maximum value a Short can have.
- Since:
JDK1.1
MIN_VALUE
public static final short MIN_VALUE
- The minimum value a Short can have.
- Since:
JDK1.1
TYPE
public static final java.lang.Class TYPE
- The Class object representing the primitive type short.
- Since:
JDK1.1
Short
public Short(short value)
- Constructs a Short object initialized to the specified short value.
- Parameters:
- value - the initial value of the Short
- Since:
- JDK1.1
Short
public Short(String s) throws NumberFormatException
- Constructs a Short object initialized to the value specified by the
String parameter. The radix is assumed to be 10.
- Parameters:
- s - the String to be converted to a Short
- Throws: NumberFormatException
- If the String does not
contain a parsable short.
- Since:
- JDK1.1
byteValue
public byte byteValue()
- Returns the value of this Short as a byte.
- Overrides:
- byteValue in class Number
- Since:
- JDK1.1
decode
public static java.lang.Short decode(String nm) throws NumberFormatException
- Decodes a String into a Short. The String may represent
decimal, hexadecimal, and octal numbers.
- Parameters:
- nm - the string to decode
- Since:
- JDK1.1
doubleValue
public double doubleValue()
- Returns the value of this Short as a double.
- Overrides:
- doubleValue in class Number
- Since:
- JDK1.1
equals
public boolean equals(Object obj)
- Compares this object to the specified object.
- Parameters:
- obj - the object to compare with
- Returns:
- true if the objects are the same; false otherwise.
- Overrides:
- equals in class Object
- Since:
- JDK1.1
floatValue
public float floatValue()
- Returns the value of this Short as a float.
- Overrides:
- floatValue in class Number
- Since:
- JDK1.1
hashCode
public int hashCode()
- Returns a hashcode for this Short.
- Overrides:
- hashCode in class Object
- Since:
- JDK1.1
intValue
public int intValue()
- Returns the value of this Short as an int.
- Overrides:
- intValue in class Number
- Since:
- JDK1.1
longValue
public long longValue()
- Returns the value of this Short as a long.
- Overrides:
- longValue in class Number
- Since:
- JDK1.1
parseShort
public static short parseShort(String s) throws NumberFormatException
- Assuming the specified String represents a short, returns
that short's value. Throws an exception if the String cannot
be parsed as a short. The radix is assumed to be 10.
- Parameters:
- s - the String containing the short
- Throws: NumberFormatException
- If the string does not
contain a parsable short.
- Since:
- JDK1.1
parseShort
public static short parseShort(String s,
int radix) throws NumberFormatException
- Assuming the specified String represents a short, returns
that short's value. Throws an exception if the String cannot
be parsed as a short.
- Parameters:
- s - the String containing the short
- radix - the radix to be used
- Throws: NumberFormatException
- If the String does not
contain a parsable short.
- Since:
- JDK1.1
shortValue
public short shortValue()
- Returns the value of this Short as a short.
- Overrides:
- shortValue in class Number
- Since:
- JDK1.1
toString
public static java.lang.String toString(short s)
- Returns a new String object representing the specified
Short. The radix is assumed to be 10.
- Parameters:
- s - the short to be converted
- Since:
- JDK1.1
toString
public java.lang.String toString()
- Returns a String object representing this Short's value.
- Overrides:
- toString in class Object
- Since:
- JDK1.1
valueOf
public static java.lang.Short valueOf(String s,
int radix) throws NumberFormatException
- Assuming the specified String represents a short, returns a
new Short object initialized to that value. Throws an
exception if the String cannot be parsed as a short.
- Parameters:
- s - the String containing the integer
- radix - the radix to be used
- Throws: NumberFormatException
- If the String does not
contain a parsable short.
- Since:
- JDK1.1
valueOf
public static java.lang.Short valueOf(String s) throws NumberFormatException
- Assuming the specified String represents a short, returns a
new Short object initialized to that value. Throws an
exception if the String cannot be parsed as a short.
- Parameters:
- s - the String containing the integer
- Throws: NumberFormatException
- If the String does not
contain a parsable short.
- Since:
- JDK1.1
All Packages Class Hierarchy This Package Previous Next Index